//
//  MainTabBarController.swift
//  Swift-30-demo
//
//  Created by apple on 2021/11/22.
//

import UIKit

class MainTabBarController: CYLTabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        self.tabBarItemsAttributes = tabBarItemsAttributesForController()
        self.viewControllers = viewControllers()
        self.setTintColor(UIColor.init(red: 38/255.0, green: 42/255.0, blue: 51/255.0, alpha: 1))
        self.hideTabBarShadowImageView()
    }
    

    func viewControllers() -> [UINavigationController]{
        let home = UINavigationController(rootViewController: ViewController())
        let personal =   UINavigationController(rootViewController: PersonalViewController())
        let viewControllers = [home, personal]
        
        return viewControllers
    }
    

    func tabBarItemsAttributesForController() ->  [[String : String]] {
        
        let tabBarItemOne = [CYLTabBarItemTitle:"首页",
                             CYLTabBarItemImage:"home_tabbar_icon",
                             CYLTabBarItemSelectedImage:"home_tabbar_select_icon"]
        
        let tabBarItemFour = [CYLTabBarItemTitle:"我的",
                              CYLTabBarItemImage:"personal_tabbar_icon",
                              CYLTabBarItemSelectedImage:"personal_tabbar_select_icon"]
        let tabBarItemsAttributes = [tabBarItemOne, tabBarItemFour]
        return tabBarItemsAttributes
    }
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
